<?php

use App\Models\Category;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $categories = [
            [
                'name'        => '体育天地',
                'description' => '分享体育新闻最新战况',
            ],
            [
                'name'        => '娱乐八卦',
                'description' => '分享娱乐世界八卦事',
            ],
            [
                'name'        => '数码天地',
                'description' => '分享数码科技最新动态',
            ],
            [
                'name'        => '公告',
                'description' => '站点公告',
            ],
        ];
        DB::table('categories')->insert($categories);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        DB::table('categories')->truncate();
    }
};
